
:root {
    --td-bg-color-resource: #f9f9fb;
}

:root[theme-mode="dark"] {
    --td-bg-color-resource: #2c2c2c;
    .t-dialog {
        background: var(--bg-color-container);
        border-color: var(--component-border);
    }
    .tdesign-source-block-image {
        .light {
            display: none;
        }
        .dark {
            display: block;
        }
    }
}

.tdesign-document {
    background-color: var(--bg-color-secondarypage);
}

.tdesign-source-header {
    width: 100%;
    margin-top: var(--header-height);
    background-color: var(--bg-color-container);
    box-sizing: border-box;
    
    .content {
        position: relative;
        height: var(--doc-header-height);
        display: flex;
        flex-direction: column;
        color: var(--text-primary);
        justify-content: flex-end;
        padding: 48px;
        width: 100%;
        max-width: 1440px;
        box-sizing: border-box;
        margin: auto;

        @media screen and (max-width: 959px) {
            padding: 48px 24px;
        }
    }

    h1 {
        font-size: 48px;
    }

    .description {
        font-size: 14px;
        line-height: 22px;
        margin-top: 16px;
        color: var(--text-secondary);
    }
}

.tdesign-source-content {
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
}

.tdesign-source {
    padding: 0 48px;
    max-width: 1440px;
    box-sizing: border-box;
    margin: 64px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content:center;

    @media screen and (max-width: 959px) {
        padding: 0 24px;
    }

    .title {
        margin-bottom: 24px;
        font-size: 20px;
        line-height: 28px;
        color: var(--text-primary);
        display: flex;
        align-items: center;

        > span {
            font-size: 16px;
            padding: 0 10px;
            margin-left: 8px;
            background: var(--component-border);
            border-radius: 3px;
            line-height: 24px;
            font-weight: normal;
            color: var(--text-secondary);
        }
    }

    & > section {
        max-width: 2464px;
        width: 100%;
    }
}

.tdesign-source-block {
    margin-right: 24px;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-color-container);
    border: 1px solid var(--component-border);
    border-radius: 6px;
    transition: transform .24s cubic-bezier(.38, 0, .24, 1), box-shadow .24s linear;
    display: inline-block;
    cursor: pointer;
    
    @media screen and (max-width: 959px) {
        width: 100%;
        margin-right: 0;
    }

    @media screen and (min-width: 960px) and (max-width: 1199px) {
        width: ~"calc((100% - 24px) / 2)";
        &:nth-of-type(2n) {
            margin-right: 0;
        }
    }

    @media screen and (min-width: 1200px) and (max-width: 1439px) {
        width: ~"calc((100% - 48px) / 3)";
        &:nth-of-type(3n) {
            margin-right: 0;
        }
    }

    @media screen and (min-width: 1440px) {
        width: ~"calc((100% - 72px) / 4)";
        &:nth-of-type(4n) {
            margin-right: 0;
        }
    }


    &:hover {
        transform: translateY(-4px);
        box-shadow: 0px 6px 30px 5px rgba(0, 0, 0, 0.05), 0px 16px 24px 2px rgba(0, 0, 0, 0.04), 0px 8px 10px -5px rgba(0, 0, 0, 0.08);
    }

    &-image {
        width: 100%;
        height: auto;
        overflow: hidden;

        img {
            width: 100%;
            object-fit: cover;
            border-radius: 3px;
        }

        .dark {
            display: none;
        }
    }

    &-tag-waiting {
        font-size: 14px;
        height: 24px;
        display: inline-flex;
        align-items: center;
        color: var(--warning-main);
        background: var(--warning-main-light);
        border-radius: 3px;
        padding: 1px 6px;
        margin-left: 12px;
    }

    &-tag-todo {
        font-size: 14px;
        height: 24px;
        display: inline-flex;
        align-items: center;
        color: var(--text-secondary);
        background: var(--bg-color-tag);
        border-radius: 3px;
        padding: 1px 6px;
        margin-left: 12px;
    }

    &-tag-new {
        font-size: 14px;
        height: 24px;
        display: inline-flex;
        align-items: center;
        color: var(--success-main);
        background: var(--success-main-light);
        border-radius: 3px;
        padding: 1px 6px;
        margin-left: 12px;
    }

    &-title {
        margin: 12px 0 4px;
        display: flex;
        align-items: center;
        font-size: 16px;
        line-height: 24px;
        display: flex;
        color: var(--text-primary);
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        @media screen and (min-width: 1440px) {
            font-size: 18px;
            line-height: 28px;
        }
    }

    &-detail {
        font-size: 14px;
        color:  var(--text-placeholder);
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;

        a {
            color: var(--text-interactive);
            text-decoration: none;
        }
    }
}
